package com.xmotor.test_import_annotation.ImportBeanDefinitionRegistrar;

import com.xmotor.test_import_annotation.model.TestD;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @Description 测试ImportBeanDefinitionRegistrar
 * @Author Dang Xianyue
 * @Date 2020-08-15 14:09
 * @Version 1.0
 */
public class TestImportBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {
    @Override
    public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {
        RootBeanDefinition rootBeanDefinition = new RootBeanDefinition(TestD.class);
        registry.registerBeanDefinition("testD",rootBeanDefinition);
    }
}
